<%-- Include --%>
<#include "../auxftl/constants.ftl">
<#include "../auxftl/inpututils.ftl">
<%@ include file="layout/includes.jsp" %>

<%-- Page layout --%>
<stripes:layout-render name="/layout/layout.jsp" title="${entityName}List">
  <stripes:layout-component name="contents">

    <%-- Load resource bundle --%>
    <fmt:setBundle basename="messages" var="msgs"/>

    <%-- Setup access to edit class --%>
    <jsp:useBean id="edit" class = "${controllerPackage}.${entityName}Edit" />

    <%-- Edit form --%>
    <stripes:form beanclass="${controllerPackage}.${entityName}Edit" focus="">

      <%-- Print errors --%>
      <stripes:errors/>

      <%-- Edit controls --%>
      <div id="pseudoLegend" ><fmt:message bundle="${'$'}{msgs}" key="custom.global.title.searchFilter"/><a id="pseudoLegendWrapper" class="wrapperArrowUp" href="javascript:toggleVisibility('wrapFieldset', 'pseudoLegendWrapper')"></a></div>
      <fieldset id='wrapFieldset'>
        <@renderProperties />

        <%-- Edit submit buttons --%>
        <div class="buttons">
          <stripes:submit name="doSave"><fmt:message bundle="${'$'}{msgs}" key="custom.global.button.save"/></stripes:submit>
            <c:if test="${'$'}{(!empty actionBean) && (!empty actionBean.${componentName}.${pojo.identifierProperty.name})}">
              <stripes:submit name="doDelete"><fmt:message bundle="${'$'}{msgs}" key="custom.global.button.delete"/></stripes:submit>
            </c:if>
        </div>
      </fieldset>
    </stripes:form>
  </stripes:layout-component>
</stripes:layout-render>
